package e

var msgMap = map[uint]string{
	Success:       "ok",
	Error:         "fail",
	InvalidParams: "请求参数错误",

	ErrorExistUser:    "该用户名已经存在",
	ErrorNotExistUser: "该用户不存在",
	ErrorNotCompare:   "账号或密码错误",

	ErrorAuthToken:            "Token 生成失败",
	ErrorAuthCheckTokenFailed: "Token 鉴权失败",
	ErrorAuthTokenIsNull:      "Token 不能为空",
	ErrorAuthCheckTokenExpire: "Token 已超时",

	ErrorAuthEmailToken:        "Email Token 生成失败",
	ErrorAuthEmailTokenFailed:  "Email Token 鉴权失败",
	ErrorCheckEmailTokenExpire: "Email Token 已超时",
	ErrorSendEmailFailed:       "发送邮箱失败",

	ErrorDataBase:       "数据库操作出错，请重试",
	ErrorFileExt:        "文件格式不正确",
	ErrorUploadFileFail: "上传文件失败",
}

func GetMsg(code uint) string {
	msg, ok := msgMap[code]
	if ok {
		return msg
	}
	return msgMap[Error]
}
